#include <iostream>
 using namespace std;

 int abs1(int a);
 double abs1(double a);

 int main ( )
 {
     int t,a;
     double b;

     cout<<"this program is used to calculate the absolute value"<<endl;
     cout<<"select the type of the namber:int 1; double 2;"<<endl;
     cin>>t;

     if (t==1)
     {
        cout<<"enter the namber which type is int "<<endl;
        cin>>a;
        a=abs1(a);
        cout<<"the absolute value is "<<a<<endl;
     }
     else
     {
         cout<<"enter the namber which type is int "<<endl;
         cin>>b;
         b=abs1(b);
         cout<<"the absolute value is "<<b<<endl;
     }

     cin>>t;
     return 0;
 }

 int abs1(int a)
 {
     if(a>=0) a=a;
     else a=-1*a;

     return a;
 }

 double abs1(double a)
 {
     return(a>0?a:-1*a);
 }